{literal}
<script language="JavaScript">
function ventana()
{	window.open('','window1',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=405,height=388,left=500,top=150");
   	document.form1.target = "window1";
	document.form1.submit();
}	
{/literal}
</script>

{if $button.next eq "Votar" and $survey.redirect_page eq "resultsp"}
	<form method="POST" action="survey.php" name="form1" target= "window1">
	<input type="hidden" name="next" value="{$button.next|default:"Next Page&nbsp;&gt;&gt;"}">
{else}
	<form method="POST" action="survey.php">
{/if}
<input type="hidden" name="sid" value="{$survey.sid}">
  <table width="100%"{*"83%"*} height="100%" align="center" {*class="bordered_table"*}>
    <tr valign="top" {*style="vertical-align:top;padding-top:50px;"*}>
      <td >
	  {*MESSAGE*} 
	      {section name="message" loop=1 show=$message} 
              <div class="message">{$message}</div>
          {/section}
	  {*ERROR*}    
	  {*{section name="error" loop=1 show=$error} 
        <div class="error">{$error}</div>
        {/section} *}
		
		{*NUMBER OF PAGES*}
		{if $survey.total_pages > 1}
			{section name="page" loop=1 show=$show.page_num} 
			<div> Pagina {$survey.page} de {$survey.total_pages} </div>
			<div></div>
			{/section} 
		{/if}
		
		{*TIME LIMIT*} {section name="time_limit" loop=1 show=$survey.time_limit} 
        <div> Time Limit: {$survey.time_limit} minutes. Approximate Elapsed Time: 
          {$survey.elapsed_minutes}:{$survey.elapsed_seconds} </div>
        {/section}
		
        {*WELCOME MESSAGE{section name="welcome" loop=1 show=$show.welcome|default:FALSE} 
        <div>{$survey.welcome_text}</div>
        {/section}*}
	  
	  {*QUESTIONS*} {section name="question" loop=1 show=$show.question|default:FALSE} 
       {*<div>*}{$question_text|unescape}{*</div>*}
        {/section} 
	  
	  {*THANK YOU MESSAGE*} {section name="thank_you" loop=1 show=$show.thank_you|default:FALSE} 
        <div>{$survey.thank_you_text}</div>
        {/section} 
		{*QUIT SURVEY MESSAGE*} {section name="quit" loop=1 show=$show.quit|default:FALSE} 
        <div> You have quit answering this survey. Your answers were not saved.</div>
        {/section} 
		
		{*MAIN LINK*} {section name="main_url" loop=1 show=$show.main_url|default:FALSE} 
        <div style="text-align:center">
            <br />
          [ <a href="{$conf.html}/index.php">Volver al menu </a> ] </div>
        {/section} 
		
		{*MAIN BUTTON*} 
        <div style="text-align:center">
          <p>
		    {if $boton == "encuestaCerrada"}
			   <STRONG><FONT color="#FF0000">ENCUESTA CERRADA</FONT></STRONG>
			{elseif $boton == "quitarBoton"}  
			   <STRONG><FONT color="#FF0000">ENCUESTA NO ACTIVADA </FONT></STRONG>
			{elseif $boton != "encuestaCerrada" and $boton != "quitarBoton" }  
			  {section name="next" loop=1 show=$show.next_button} &nbsp; 
                {if $button.next eq "Votar" and $survey.redirect_page eq "resultsp"}
			       <input type="button" onclick={if $preview != TRUE}"ventana();return false;"{else}"window.open('{$conf.html}/results.php?sid={$survey.sid}&noLinks=1','mywindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=410,height=400,left=30,top=30');"{/if} name="next" 
			       value="{$button.next|default:"Next Page&nbsp;&gt;&gt;"}">
    			{else}
			       <input type="submit" name="next" value="{$button.next|default:"Next Page&nbsp;&gt;&gt;"}">
			       
			    {/if}
          </p>
          <p>
		      {/section}
			{/if} 
		  </p>
          <p align="center"> {section name="next" loop=1 show=$show.next_button}[
		                                         {*$survey.public[s].sid*}
            <a href="{*{$conf.html}/survey.php?sid={$survey.sid}*}#" onClick={if $preview != TRUE}"window.open('{$conf.html}/results.php?sid={$survey.sid}{$survey.public[s].sid}&np={$npreg}','mywindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=410,height=400,left=30,top=30');"{else}"window.open('{$conf.html}/results.php?sid={$survey.sid}&noLinks=1','mywindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=410,height=400,left=30,top=30');"{/if}>Ver 
            Resultados</a> ] </p>
          <p> &nbsp; {/section} 
          </p>
        </div>	  
		  
      </td>
    </tr>
  </table>
</form>
